diff options
Diffstat (limited to 'app/[lng]/evcp/(evcp)/menu-list/page.tsx')
| -rw-r--r-- | app/[lng]/evcp/(evcp)/menu-list/page.tsx | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/app/[lng]/evcp/(evcp)/menu-list/page.tsx b/app/[lng]/evcp/(evcp)/menu-list/page.tsx index 6645127f..5a1f71a5 100644 --- a/app/[lng]/evcp/(evcp)/menu-list/page.tsx +++ b/app/[lng]/evcp/(evcp)/menu-list/page.tsx @@ -10,13 +10,31 @@ import { MenuListTable } from "@/lib/menu-list/table/menu-list-table"; import { Shell } from "@/components/shell" import * as React from "react" import { InformationButton } from "@/components/information/information-button"; -export default async function MenuListPage() { +import { useTranslation } from "@/i18n"; +interface MenuListPageProps { + params: Promise<{ lng: string }> +} + +export default async function MenuListPage({ params }: MenuListPageProps) { + const { lng } = await params + const { t } = await useTranslation(lng, 'menu') + // 초기 데이터 로드 const [menusResult, usersResult] = await Promise.all([ getMenuAssignments(), getActiveUsers() ]); + // 서버사이드에서 번역된 메뉴 데이터 생성 + const translatedMenus = menusResult.data?.map(menu => ({ + ...menu, + sectionTitle: menu.sectionTitle || "", + translatedMenuTitle: t(menu.menuTitle || ""), + translatedSectionTitle: t(menu.sectionTitle || ""), + translatedMenuGroup: menu.menuGroup ? t(menu.menuGroup) : null, + translatedMenuDescription: menu.menuDescription ? t(menu.menuDescription) : null + })) || []; + return ( <Shell className="gap-2"> <div className="flex items-center justify-between space-y-2"> @@ -60,7 +78,7 @@ export default async function MenuListPage() { <CardContent> <Suspense fallback={<div className="text-center py-8">로딩 중...</div>}> <MenuListTable - initialMenus={menusResult.data || []} + initialMenus={translatedMenus} initialUsers={usersResult.data || []} /> </Suspense> |
